package com.lzy.cloud.order.dos;

import com.lzy.cloud.order.constants.OrderStatusDesEnum;
import com.lzy.cloud.order.dtos.OrderActionDto;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class OrderActionDO {

	/** 订单编号 */
	private String orderId;

	/** 订单类型 1:房车销售2:房车租赁3:露营地4:户外装备5:路线 */
	private Integer type;

	/** 会员ID */
	private Long memberId;

	/** 操作者 */
	private Long operateId;
	private String operateName;

	/** 小状态 */
	private OrderStatusDesEnum osde;

	/** 大状态 */
	private Integer maxStatus;

	/** 车状态 */
	private Integer carStatus;

	/** 是否插入订单状态表：默认要 */
	private Boolean v = true;

	private Integer refund;

	private Integer payStatus = 1;
	// 是否发货
	private Integer goodStatus = 0;
	/** 用户行为 */
	private String customerMethod;
	/** 商家行为 */
	private String shopMethod;
	/** 运营行为 */
	private String adminMethod;
	/**发货时间*/
	private Date sendTime;
	/**实际支付金额*/
	private BigDecimal moneyPaid;
	/**支付时间*/
	private Date payTime;
	/** 付款方式 */
	private Integer payWay;
	/**完成时间*/
	private Date completeTime;
	private Date stopPayTime;
	/** 备注 */
	private String remark;

	public static OrderActionDO readFromDTO(OrderActionDto oaDTO) {
		OrderActionDO result = new OrderActionDO();
		if (null == oaDTO) {
			return null;
		}
		result.setOperateId(oaDTO.getOperateId());
		result.setOperateName(oaDTO.getOperateName());
		result.setOrderId(oaDTO.getOrderId());
		result.setType(oaDTO.getType());
		result.setMemberId(oaDTO.getMemberId());
		result.setPayStatus(oaDTO.getPayStatus());
		result.setGoodStatus(oaDTO.getGoodStatus());
		result.setRemark(oaDTO.getRemark());
		return result;
	}
}
